Jump to content

robolist

Members
  • Posts

    20
  • Joined

  • Last visited

About robolist

  • Birthday 06/07/1980

Profile Information

  • Gender
    Male
  • Location
    Phuket, Thailand... But originally from London, UK

robolist's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I tired that, but it didnt work. Nothing worked when i put the event rule on top, in fact the site was all messed up. Thanks, that makes a lot of sense. Can you please advise me of the best solution? I've tried so many variations without any luck.
  2. I have successfully created my mod_rewrite rule to change all dynamic URLs on the top level of the site, but now i need to create a rule for a second level, and i think later down the line i might need a second, second level of rewrites. At the moment i have this RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.+)$ index.php?subj=$1 And this helps to change /index.php?subj=home to /home as it does for all other pages such as /contact /about /events and so on. But now I have created sub pages under events and therefore need to change /events.php?event=event-name to events/event-name. But when i add another rule it messes up the whole site. What i tried to do is this RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.+)$ index.php?subj=$1 RewriteRule ^events/(.+)$ event.php?event=$1 I've even tried it with [L] flags after the Rewrite rules, but nothing seems to work, I would really appreciate it if someone can show me the best way to do this as nothing seems to work. Many thanks in advance
  3. It worked a treat, thanks so much. Don't you just hate it when the obvious answer is right in front of you but you just can't see it? haha I should have thought of that in the first place Many thanks for your help Rob
  4. Cheers, I didn't notice there was a 'mod_rewrite' forum.
  5. I'm fairly new to developing sites with dynamically generated pages and have just built my first CMS. Currently all pages come off the index and are pulled from its ID number and their URLs are like this mydomain.com/directory/index.php?subj=1 Its still in production so i only have three pages; Home, Events and Contact. Each one is represented by ID 1, 2 and 3. I have managed to create an .htaccess file and have successfully changed the URL to mydomain.com/directory/1/ (although i think im going to remove that trailing slash). But what i really want to do is pull the page title (except for home which should come off the root) but i just cant seem to get my head around it. If anyone could point me in the right direction I would be very grateful. Basically I need the URL to look something like this mydomain.com/directory/contact At the moment my .htsccess file looks like this RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^([a-zA-Z0-9]+)/$ index.php?subj=$1 Cheers
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.