8

User-friendly URLs for profiles

 3 years ago
source link: https://www.codesd.com/item/user-friendly-urls-for-profiles.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

User-friendly URLs for profiles

advertisements

I have the following link:

www.website.com/profile.php?user=Test

I want to change the link to be:

www.website.com/Test

Where the username is after the / without any extra gibberish.

I have this set up in my .htaccess file, but it's not working. Why?

Options +SymLinksIfOwnerMatch
RewriteEngine on

RewriteBase /website

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ profile.php?user=$1 [R,L,QSA]

Thanks.


Try this

Options +SymLinksIfOwnerMatch
RewriteEngine on

RewriteBase /website

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ profile.php?user=$1 [L,QSA]

Now you can access page from this URL.

www.website.com/Test

Related Articles

User-friendly URLs for the Spring mvc application

I have an application with urls like site.com/article/1/title.htm I have @RequestMapping /article/{id}/{title}.htm that server this request and gets the article. What I am looking achieve is to have a url like site.com/title.htm but cant think of a w

Using User-Friendly URLs for SEO in ASP.NET

I am in a situation where I want to restructure my site's urls. That is I have a page that lists the article names (with each article name as a link). As shown below: ARTICLE1 ARTICLE2 ARTICLE3 Now if I click on an article I want the url to be as fol

User Friendly Url Ajax post

Problem solved I'm using friendly url and code which is described below. I want to Request php file with ajax post. Does anybody know how to do that? For example: I have code below: $(document).ready(function(){ $.ajax({ type: "POST", url: "

User-friendly URLs without htaccess

I want to create friendly urls for my website script only using PHP, right now im using the query style (Ex: index.php?location=register) and i would like to convert them to something like this: https://www.sitename.com/index.php/Register Right now i

Convert vBulletin to Drupal but maintain friendly URLs for SEO?

I'm fed up with VB and looking to convert a big vBulletin board to Drupal. But I don't want to lose the links of the friendly urls and risk having everything re-indexed by Google. How can I maintain those urls? The site and huge has been around since

Like button - Use friendly rewrite URL and non-friendly URL for count value

My site has an FB like button on a dynamic page. There are also mod re-write rules on the site to allow a friendly URL for that dynamic page. i.e the following opages are the 'same': (url 1) www.getawayearth.com/property.php?id=703 (url 2) www.getawa

Technique for creating user-friendly URLs

Possible Duplicate: How to create friendly URL in php? I have read a lot of content on Google about turning profile.php?id=24 into something more user friendly. How would I go about redirecting a link like www.site.com/profile/username to profile.php

htaccess redirection for user-friendly URLs

I have my htaccess file setup, so that the pages remove extensions. Now, I am trying to make the pages that transfer variables, into SEO friendly urls ... so, for example... http://www.example.com/art-gallery?page=2 ... which is actually "art-gallery

How to configure a friendly URL for a hidden page in WebSphere Portal 7

We need to create a couple of pages for our WebSphere Portal 7 installation which a user can access without having to log in to the portal. We'd also like these pages to have friendly URLs (e.g. http://portal/wps/somePage). We'd like the page to be "

how to convert pre-existing categories and products to user-friendly URLs

I have recently taken on a project to convert an old shopping cart site (custom developed) to a modern SEO friendly site here is my problem the current site utilizes URL's like the below http://www.domain.com/page.php?id=XX i would like to convert th

Rename internal page URLs to connect to user-friendly URLs by using .htaccess

I want to rename the following URLs to SEO friendly URL. Change the following URL : http://www.peacockgirls.com/index.php?page=1 into http://www.peacockgirls.com Change the following URL : http://www.peacockgirls.com/index.php?page=2 into http://www.

Analysis of friendly URLs for SEO. How?

I am trying to build a "standard" website in which the path to articles have SEO friendly URL Something like this: www.test.com/library/book-34/chatper-4/page-10/ The website is build with PHP and mySQL. In this example we access the content of

User-friendly URLs with WebMatrix and razor

I'm new to ASP.NET and I'm learning first in WebMatrix using razor syntax. In PHP I used .htaccess to route URLs to database posts, for example: http://mywebsite.com/linux/how-to-install-wamp-in-ubuntu-12.04 In that case routes to file: http://mywebs

Why does the user-friendly URL with the ASP.NET MVC5 routing attributes not work every time?

I want to know why a friendly URL is generated from one action and not on the other. Let's me show you! [RoutePrefix("fr-ca/guest")] public class GuestController : BaseController { [Route("users/{id:int}/{ids:int}")] public ActionResul

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK